<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Insert title here</title>
    <script type="text/javascript" src="../js/jquery-3.5.0.min.js"></script>
    <script>
        function hideFn() {
            //$("#showDiv").hide("slow","swing")
            //$("#showDiv").slideUp("slow");
            $("#showDiv").fadeOut("slow")
        }
        function showFn() {
           /* $("#showDiv").show("slow","swing",function () {
                alert("显示了")
            })*/
           //$("#showDiv").slideDown("slow");
            $("#showDiv").fadeIn("slow")
        }
        function toggleFn() {
            //$("#showDiv").toggle("slow")
            //$("#showDiv").slideToggle("slow")
            $("#showDiv").fadeToggle("slow")
        }
    </script>
</head>
<body>
<input type="button" value="点击按钮隐藏div" onclick="hideFn()">
<input type="button" value="点击按钮显示div" onclick="showFn()">
<input type="button" value="点击按钮切换div显示和隐藏" onclick="toggleFn()">

<div id="showDiv" style="width:300px;height:300px;background:pink">
    div显示和隐藏
</div>
</body>
</html>
